class Shape {
  public function foo() {
     print("Base foo");
  }
  public function paint():void {
     foo();
  } 
}

class Rectangle extends Shape{
  public override function paint():void {
     super.paint();
     print( "Rectangle");
  } 
}

class Circle extends Shape{
  public override function paint():void {
     super.paint();
     print( "Circle");
  } 
}

var shapes = [new Rectangle(),new Circle()];

for each(var s:Shape in shapes) {
   s.paint();
}

